function GetMonth(numMonth)
{
		var d = new Date();
		var month = new Array();
		month[0] = "January";
		month[1] = "February";
		month[2] = "March";
		month[3] = "April";
		month[4] = "May";
		month[5] = "June";
		month[6] = "July";
		month[7] = "August";
		month[8] = "September";
		month[9] = "October";
		month[10] = "November";
		month[11] = "December";
		var n = month[numMonth];
		return n;
}
var SelectedDate;
var _ClinicName;
var _ClinicPhone;

$(document).ready(function () {
    $("#ClinicName").html(localStorage.getItem("ClinicName") + " " + "<a id='ClinicNumber' href='tel:" + localStorage.getItem("ClinicPhone") + "'><span class='glyphicon glyphicon-earphone' id='ClinicPhoneSpan'></span>" + localStorage.getItem("ClinicPhone") + "</a>");
});

function convertStringToDate(dateString) {
    var splitedDateElement;
    if (dateString.indexOf("-") != -1)
        splitedDateElement = dateString.split('-');
    else if (dateString.indexOf("/") != -1)
        splitedDateElement = dateString.split('/');

    var dateValue = new Date(splitedDateElement[2], splitedDateElement[1] - 1, splitedDateElement[0]);
    return dateValue;
}


function GeneratePresciptionDiv(text, date, id, i) {
    var subText = text.length > 100 ? text.substring(0, 100) + " ... : " : text + " : ";
    $("#" + id).append("<div class='panel panel-default label-info' id='ReadMorePanel" + id + i + "'><div class='panel-heading' style='background-color:#fff'><h4 class='panel-title'><a data-toggle='collapse' data-target='#ReadMoreInfo" + id + i + "' href='#ReadMoreInfo" + id + i + "'> " + subText + " on " + date + " </a> </h4> </div> <div id='ReadMoreInfo" + id + i + "' class='panel-collapse collapse'><div class='panel-body'>" + text + "<br/>" + date + "</div></div></div>");
}